Trigger to close/remove previously defined Dialog Box

Hi All,

I currently have the situation where I have a post-open module trigger that creates a dialog box called "welcomeDB" that exists as long as the user does not close the dialog box or exits the DOORS program. My DXL code displays this dialog box using the "show" function.

I wish to create another trigger that upon closing the current module, the "welcomeDB' dialog box will also be closed and will not be accessible for further use. Having looked around the forums, I haven't been able to determine how exactly I can implement some DXL to effectively "hide(welcomeDB)", as the DXL in the separate trigger would not understand the variable "welcomeDB" defined in a different trigger, saying it is undefined.

Is anyone able to assist me here?

Thanks, Daniel


dyfuse - Wed Dec 10 00:44:42 EST 2014

Re: Trigger to close/remove previously defined Dialog Box
Wolfgang Uhr - Wed Dec 10 03:21:51 EST 2014

Hi

Don't use a trigger for that. Better is:

Module mdlWork = current; // resp. the correct module

DB dbxx = create(mdlWork, "DialogTitle"); // use the module insde of crreate

show(dbxx); // Now you can use show and the dialog is closed if the module is closed

Best regards

Wolfgang

Re: Trigger to close/remove previously defined Dialog Box
dyfuse - Wed Dec 10 16:49:33 EST 2014

Wolfgang Uhr - Wed Dec 10 03:21:51 EST 2014

Hi

Don't use a trigger for that. Better is:

Module mdlWork = current; // resp. the correct module

DB dbxx = create(mdlWork, "DialogTitle"); // use the module insde of crreate

show(dbxx); // Now you can use show and the dialog is closed if the module is closed

Best regards

Wolfgang

Thanks for your suggestion Wolfgang.

Unfortunately your solution above does not work, and the dialog box that is created still remains open after closing/exiting the module.

 

Is anyone able to suggest another solution?

Re: Trigger to close/remove previously defined Dialog Box
llandale - Wed Dec 10 18:37:47 EST 2014

Wolfgang Uhr - Wed Dec 10 03:21:51 EST 2014

Hi

Don't use a trigger for that. Better is:

Module mdlWork = current; // resp. the correct module

DB dbxx = create(mdlWork, "DialogTitle"); // use the module insde of crreate

show(dbxx); // Now you can use show and the dialog is closed if the module is closed

Best regards

Wolfgang

Yes, the module handle just means the module window is brought to the front when the dialog closes.

Re: Trigger to close/remove previously defined Dialog Box
llandale - Wed Dec 10 18:46:21 EST 2014

Check out this file:

  • <install directory>\lib\Dxl\utils\moduleDB.inc

You would do this at the top of your dxl:

  • #include <utils\moduleDB.inc>

put this before your "show"

  • close(myDialog, clbkClose)
  • current = modMyModule
  • modDB_tie(myDialog)

You must have an explict "close" callback.  That callback does this, before hiding/destroying the dialog:

  • void clbkClose(DB dbXX)
  • {  modDB_untie(myDialog)
  •    hide(myDialog)
  •    destroy(myDialog)
  • } // end clbkClose

Failure to untie when you manually close the dialog will result in errors when you subsequently close the module.

-Louie

I did that for myself some years ago before I came across this file; and the solutions are practically the same.

that include file is clean and actually has comments!  Dang near the best supplied DXL I've seen.

Re: Trigger to close/remove previously defined Dialog Box
dyfuse - Wed Dec 10 19:53:20 EST 2014

llandale - Wed Dec 10 18:46:21 EST 2014

Check out this file:

  • <install directory>\lib\Dxl\utils\moduleDB.inc

You would do this at the top of your dxl:

  • #include <utils\moduleDB.inc>

put this before your "show"

  • close(myDialog, clbkClose)
  • current = modMyModule
  • modDB_tie(myDialog)

You must have an explict "close" callback.  That callback does this, before hiding/destroying the dialog:

  • void clbkClose(DB dbXX)
  • {  modDB_untie(myDialog)
  •    hide(myDialog)
  •    destroy(myDialog)
  • } // end clbkClose

Failure to untie when you manually close the dialog will result in errors when you subsequently close the module.

-Louie

I did that for myself some years ago before I came across this file; and the solutions are practically the same.

that include file is clean and actually has comments!  Dang near the best supplied DXL I've seen.

Thanks Louie! Worked a treat!

And you were right about that DXL in moduleDB.inc...very nicely coded